Optimal. Leaf size=163 \[ \frac {2 a^2 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {5 a^2 \cot (c+d x)}{d}-\frac {3 a^2 \cot ^3(c+d x)}{d}-\frac {7 a^2 \cot ^5(c+d x)}{5 d}-\frac {2 a^2 \cot ^7(c+d x)}{7 d}-\frac {2 a^2 \csc (c+d x)}{d}-\frac {2 a^2 \csc ^3(c+d x)}{3 d}-\frac {2 a^2 \csc ^5(c+d x)}{5 d}-\frac {2 a^2 \csc ^7(c+d x)}{7 d}+\frac {a^2 \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.18, antiderivative size = 163, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 8, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3957, 2952,
3852, 2701, 308, 213, 2700, 276} \begin {gather*} \frac {a^2 \tan (c+d x)}{d}-\frac {2 a^2 \cot ^7(c+d x)}{7 d}-\frac {7 a^2 \cot ^5(c+d x)}{5 d}-\frac {3 a^2 \cot ^3(c+d x)}{d}-\frac {5 a^2 \cot (c+d x)}{d}-\frac {2 a^2 \csc ^7(c+d x)}{7 d}-\frac {2 a^2 \csc ^5(c+d x)}{5 d}-\frac {2 a^2 \csc ^3(c+d x)}{3 d}-\frac {2 a^2 \csc (c+d x)}{d}+\frac {2 a^2 \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 213
Rule 276
Rule 308
Rule 2700
Rule 2701
Rule 2952
Rule 3852
Rule 3957
Rubi steps
\begin {align*} \int \csc ^8(c+d x) (a+a \sec (c+d x))^2 \, dx &=\int (-a-a \cos (c+d x))^2 \csc ^8(c+d x) \sec ^2(c+d x) \, dx\\ &=\int \left (a^2 \csc ^8(c+d x)+2 a^2 \csc ^8(c+d x) \sec (c+d x)+a^2 \csc ^8(c+d x) \sec ^2(c+d x)\right ) \, dx\\ &=a^2 \int \csc ^8(c+d x) \, dx+a^2 \int \csc ^8(c+d x) \sec ^2(c+d x) \, dx+\left (2 a^2\right ) \int \csc ^8(c+d x) \sec (c+d x) \, dx\\ &=\frac {a^2 \text {Subst}\left (\int \frac {\left (1+x^2\right )^4}{x^8} \, dx,x,\tan (c+d x)\right )}{d}-\frac {a^2 \text {Subst}\left (\int \left (1+3 x^2+3 x^4+x^6\right ) \, dx,x,\cot (c+d x)\right )}{d}-\frac {\left (2 a^2\right ) \text {Subst}\left (\int \frac {x^8}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=-\frac {a^2 \cot (c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{d}-\frac {3 a^2 \cot ^5(c+d x)}{5 d}-\frac {a^2 \cot ^7(c+d x)}{7 d}+\frac {a^2 \text {Subst}\left (\int \left (1+\frac {1}{x^8}+\frac {4}{x^6}+\frac {6}{x^4}+\frac {4}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}-\frac {\left (2 a^2\right ) \text {Subst}\left (\int \left (1+x^2+x^4+x^6+\frac {1}{-1+x^2}\right ) \, dx,x,\csc (c+d x)\right )}{d}\\ &=-\frac {5 a^2 \cot (c+d x)}{d}-\frac {3 a^2 \cot ^3(c+d x)}{d}-\frac {7 a^2 \cot ^5(c+d x)}{5 d}-\frac {2 a^2 \cot ^7(c+d x)}{7 d}-\frac {2 a^2 \csc (c+d x)}{d}-\frac {2 a^2 \csc ^3(c+d x)}{3 d}-\frac {2 a^2 \csc ^5(c+d x)}{5 d}-\frac {2 a^2 \csc ^7(c+d x)}{7 d}+\frac {a^2 \tan (c+d x)}{d}-\frac {\left (2 a^2\right ) \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=\frac {2 a^2 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {5 a^2 \cot (c+d x)}{d}-\frac {3 a^2 \cot ^3(c+d x)}{d}-\frac {7 a^2 \cot ^5(c+d x)}{5 d}-\frac {2 a^2 \cot ^7(c+d x)}{7 d}-\frac {2 a^2 \csc (c+d x)}{d}-\frac {2 a^2 \csc ^3(c+d x)}{3 d}-\frac {2 a^2 \csc ^5(c+d x)}{5 d}-\frac {2 a^2 \csc ^7(c+d x)}{7 d}+\frac {a^2 \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(428\) vs. \(2(163)=326\).
time = 0.82, size = 428, normalized size = 2.63 \begin {gather*} \frac {a^2 \cos (c+d x) \sec ^4\left (\frac {1}{2} (c+d x)\right ) (1+\sec (c+d x))^2 \left (-6881280 \cos (c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+6881280 \cos (c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-32 \csc (2 c) \csc ^4\left (\frac {1}{2} (c+d x)\right ) \csc ^3(c+d x) (-9856 \sin (2 c)+17288 \sin (d x)-29056 \sin (2 d x)-7264 \sin (c-d x)+14208 \sin (c+d x)-19536 \sin (2 (c+d x))+7104 \sin (3 (c+d x))+7104 \sin (4 (c+d x))-7104 \sin (5 (c+d x))+1776 \sin (6 (c+d x))+17288 \sin (2 c+d x)+20384 \sin (3 c+d x)-23771 \sin (c+2 d x)+7104 \sin (2 (c+2 d x))-23771 \sin (3 c+2 d x)-8960 \sin (4 c+2 d x)+19984 \sin (c+3 d x)+8644 \sin (2 c+3 d x)+8644 \sin (4 c+3 d x)-6160 \sin (5 c+3 d x)+8644 \sin (3 c+4 d x)+8644 \sin (5 c+4 d x)+6720 \sin (6 c+4 d x)-12144 \sin (3 c+5 d x)-8644 \sin (4 c+5 d x)-8644 \sin (6 c+5 d x)-1680 \sin (7 c+5 d x)+3456 \sin (4 c+6 d x)+2161 \sin (5 c+6 d x)+2161 \sin (7 c+6 d x))\right )}{13762560 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 193, normalized size = 1.18
method | result | size |
norman | \(\frac {\frac {a^{2}}{224 d}+\frac {29 a^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{560 d}+\frac {163 a^{2} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{480 d}+\frac {67 a^{2} \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}-\frac {175 a^{2} \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32 d}+\frac {13 a^{2} \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{48 d}+\frac {a^{2} \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {2 a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}+\frac {2 a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(192\) |
derivativedivides | \(\frac {a^{2} \left (-\frac {1}{7 \sin \left (d x +c \right )^{7} \cos \left (d x +c \right )}-\frac {8}{35 \sin \left (d x +c \right )^{5} \cos \left (d x +c \right )}-\frac {16}{35 \sin \left (d x +c \right )^{3} \cos \left (d x +c \right )}+\frac {64}{35 \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {128 \cot \left (d x +c \right )}{35}\right )+2 a^{2} \left (-\frac {1}{7 \sin \left (d x +c \right )^{7}}-\frac {1}{5 \sin \left (d x +c \right )^{5}}-\frac {1}{3 \sin \left (d x +c \right )^{3}}-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+a^{2} \left (-\frac {16}{35}-\frac {\left (\csc ^{6}\left (d x +c \right )\right )}{7}-\frac {6 \left (\csc ^{4}\left (d x +c \right )\right )}{35}-\frac {8 \left (\csc ^{2}\left (d x +c \right )\right )}{35}\right ) \cot \left (d x +c \right )}{d}\) | \(193\) |
default | \(\frac {a^{2} \left (-\frac {1}{7 \sin \left (d x +c \right )^{7} \cos \left (d x +c \right )}-\frac {8}{35 \sin \left (d x +c \right )^{5} \cos \left (d x +c \right )}-\frac {16}{35 \sin \left (d x +c \right )^{3} \cos \left (d x +c \right )}+\frac {64}{35 \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {128 \cot \left (d x +c \right )}{35}\right )+2 a^{2} \left (-\frac {1}{7 \sin \left (d x +c \right )^{7}}-\frac {1}{5 \sin \left (d x +c \right )^{5}}-\frac {1}{3 \sin \left (d x +c \right )^{3}}-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+a^{2} \left (-\frac {16}{35}-\frac {\left (\csc ^{6}\left (d x +c \right )\right )}{7}-\frac {6 \left (\csc ^{4}\left (d x +c \right )\right )}{35}-\frac {8 \left (\csc ^{2}\left (d x +c \right )\right )}{35}\right ) \cot \left (d x +c \right )}{d}\) | \(193\) |
risch | \(-\frac {4 i a^{2} \left (105 \,{\mathrm e}^{11 i \left (d x +c \right )}-420 \,{\mathrm e}^{10 i \left (d x +c \right )}+385 \,{\mathrm e}^{9 i \left (d x +c \right )}+560 \,{\mathrm e}^{8 i \left (d x +c \right )}-1274 \,{\mathrm e}^{7 i \left (d x +c \right )}+616 \,{\mathrm e}^{6 i \left (d x +c \right )}+454 \,{\mathrm e}^{5 i \left (d x +c \right )}-1816 \,{\mathrm e}^{4 i \left (d x +c \right )}+1249 \,{\mathrm e}^{3 i \left (d x +c \right )}+444 \,{\mathrm e}^{2 i \left (d x +c \right )}-759 \,{\mathrm e}^{i \left (d x +c \right )}+216\right )}{105 d \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )^{7} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{3} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) | \(215\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 175, normalized size = 1.07 \begin {gather*} -\frac {a^{2} {\left (\frac {2 \, {\left (105 \, \sin \left (d x + c\right )^{6} + 35 \, \sin \left (d x + c\right )^{4} + 21 \, \sin \left (d x + c\right )^{2} + 15\right )}}{\sin \left (d x + c\right )^{7}} - 105 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 105 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 3 \, a^{2} {\left (\frac {140 \, \tan \left (d x + c\right )^{6} + 70 \, \tan \left (d x + c\right )^{4} + 28 \, \tan \left (d x + c\right )^{2} + 5}{\tan \left (d x + c\right )^{7}} - 35 \, \tan \left (d x + c\right )\right )} + \frac {3 \, {\left (35 \, \tan \left (d x + c\right )^{6} + 35 \, \tan \left (d x + c\right )^{4} + 21 \, \tan \left (d x + c\right )^{2} + 5\right )} a^{2}}{\tan \left (d x + c\right )^{7}}}{105 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.67, size = 272, normalized size = 1.67 \begin {gather*} -\frac {432 \, a^{2} \cos \left (d x + c\right )^{6} - 654 \, a^{2} \cos \left (d x + c\right )^{5} - 636 \, a^{2} \cos \left (d x + c\right )^{4} + 1226 \, a^{2} \cos \left (d x + c\right )^{3} + 74 \, a^{2} \cos \left (d x + c\right )^{2} - 562 \, a^{2} \cos \left (d x + c\right ) - 105 \, {\left (a^{2} \cos \left (d x + c\right )^{5} - 2 \, a^{2} \cos \left (d x + c\right )^{4} + 2 \, a^{2} \cos \left (d x + c\right )^{2} - a^{2} \cos \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + 105 \, {\left (a^{2} \cos \left (d x + c\right )^{5} - 2 \, a^{2} \cos \left (d x + c\right )^{4} + 2 \, a^{2} \cos \left (d x + c\right )^{2} - a^{2} \cos \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + 105 \, a^{2}}{105 \, {\left (d \cos \left (d x + c\right )^{5} - 2 \, d \cos \left (d x + c\right )^{4} + 2 \, d \cos \left (d x + c\right )^{2} - d \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.53, size = 168, normalized size = 1.03 \begin {gather*} \frac {35 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6720 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 6720 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + 945 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {6720 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} - \frac {10710 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 1330 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 189 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 15 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7}}}{3360 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.99, size = 159, normalized size = 0.98 \begin {gather*} \frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{96\,d}+\frac {4\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {9\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{32\,d}-\frac {-166\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+\frac {268\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{3}+\frac {163\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{15}+\frac {58\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{35}+\frac {a^2}{7}}{d\,\left (32\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-32\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________